<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="AsyncHandler,net.digitalprimates.fluint.async.AsyncHandler,EVENT_FIRED,TIMER_EXPIRED,eventHandler,passThroughData,testCase,timeout,timeoutHandler,handleEvent,handleTimeout,startTimer" name="keywords">
<title>net.digitalprimates.fluint.async.AsyncHandler</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'AsyncHandler - Fluint API';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?net/digitalprimates/fluint/async/AsyncHandler.html&amp;net/digitalprimates/fluint/async/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;AsyncHandler</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class AsyncHandler"); titleBar_setSubNav(false,true,false,false,true,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">net.digitalprimates.fluint.async</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class AsyncHandler</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">AsyncHandler <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p> 
  AsyncHandlers are created when the developer calls the TestCase.asyncHandler() 
  method.
  
  This causes the TestMethod to pend until the named event fires or the 
  timeout is reached, effectively preventing the method from failing or 
  passing until all outstanding asynchronous activity is resolved. 
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#EVENT_FIRED">EVENT_FIRED</a> : String = "eventFired"<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#eventHandler">eventHandler</a> : Function<div class="summaryTableDescription"> 
   <p>
   A reference to the event handler that should be called if the event named 
   in the TestCase.asyncHandler() method fires before the timeout is reached.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#passThroughData">passThroughData</a> : Object = null<div class="summaryTableDescription"> 
   A generic object that is optionally provided by the developer when starting 
   a new asynchronous operation.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#testCase">testCase</a> : <a href="../tests/TestCase.html">TestCase</a>
<div class="summaryTableDescription"> 
   A reference to the testCase which created this class.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#timeout">timeout</a> : int<div class="summaryTableDescription"> 
   The number of milliseconds this class should wait for its handleEvent 
   method to be called, before firing a 'timerExpired' event.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#timeoutHandler">timeoutHandler</a> : Function = null<div class="summaryTableDescription">
   <p> 
   A reference to the event handler that should be called if the event named in 
   the TestCase.asyncHandler() method does not fire before the timeout is reached.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#TIMER_EXPIRED">TIMER_EXPIRED</a> : String = "timerExpired"<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#AsyncHandler()">AsyncHandler</a>(testCase:<a href="../tests/TestCase.html">TestCase</a>, eventHandler:Function, timeout:int = 0, passThroughData:Object = null, timeoutHandler:Function = null)</div>
<div class="summaryTableDescription"> 
   Constructor.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#handleEvent()">handleEvent</a>(event:Event):void</div>
<div class="summaryTableDescription"> 
   A generic handler called by an unknown object when a specific event fires.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#handleTimeout()">handleTimeout</a>(event:TimerEvent):void</div>
<div class="summaryTableDescription"> 
   An event handler that is called by our timer if handleEvent is not called 
   before the number of milliseconds specified in the timeout property.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#startTimer()">startTimer</a>():void</div>
<div class="summaryTableDescription"> 
   Starts the timeout timer for this test.</div>
</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
</table>
</div>
<a name="eventSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Events</div>
<table id="summaryTableEvent" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Event</th><th>Summary</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#event:eventFired">eventFired</a>
</div>
</td><td class="summaryTableDescription summaryTableCol"> 
  The 'eventFired' event is fired when the event specified in the 
  TestCase.asyncHandler() method occurs.</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#event:timerExpired">timerExpired</a>
</div>
</td><td class="summaryTableDescription summaryTableCol"> 
  The 'timerExpired' event is fired when the event specified in the 
  TestCase.asyncHandler() method does not occur before the timeout 
  specified in the constructor.</td><td class="summaryTableOwnerCol">AsyncHandler</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="EVENT_FIRED"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">EVENT_FIRED</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public static var EVENT_FIRED:String = "eventFired"</code>
</div>
<a name="eventHandler"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">eventHandler</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var eventHandler:Function</code><p> 
   </p><p>
   A reference to the event handler that should be called if the event named 
   in the TestCase.asyncHandler() method fires before the timeout is reached. </p>
   
   <p>
   The handler is expected to have the follow signature:</p>
   
   <p>
   <code>public function handleEvent( event:Event, passThroughData:Object ):void {
   }</code></p>
   
   <p>
   The first parameter is the original event object.
   The second parameter is a generic object that can optionally be provided by 
   the developer when starting a new asynchronous operation.</p>
   </div>
<a name="passThroughData"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">passThroughData</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var passThroughData:Object = null</code><p> 
   A generic object that is optionally provided by the developer when starting 
   a new asynchronous operation.
   
   This generic object is passed to the eventHandler function if it is called. 
   </p></div>
<a name="testCase"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">testCase</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var testCase:<a href="../tests/TestCase.html">TestCase</a></code><p> 
   A reference to the testCase which created this class. 
   </p></div>
<a name="timeout"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">timeout</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var timeout:int</code><p> 
   The number of milliseconds this class should wait for its handleEvent 
   method to be called, before firing a 'timerExpired' event. 
   </p></div>
<a name="timeoutHandler"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">timeoutHandler</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var timeoutHandler:Function = null</code><p>
   </p><p> 
   A reference to the event handler that should be called if the event named in 
   the TestCase.asyncHandler() method does not fire before the timeout is reached. </p>
   
   <p>
   The handler is expected to have the follow signature:</p>
   
   <p><code>
   public function handleTimeoutEvent( passThroughData:Object ):void {
   }</code></p>
   
   <p>
   The parameter is a generic object that can optionally be provided by the 
   developer when starting a new asynchronous operation.</p>
   </div>
<a name="TIMER_EXPIRED"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TIMER_EXPIRED</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static var TIMER_EXPIRED:String = "timerExpired"</code>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="AsyncHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">AsyncHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function AsyncHandler(testCase:<a href="../tests/TestCase.html">TestCase</a>, eventHandler:Function, timeout:int = 0, passThroughData:Object = null, timeoutHandler:Function = null)</code><p> 
   Constructor. 
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">testCase</span>:<a href="../tests/TestCase.html">TestCase</a></code> &mdash; A reference to the TestCase class that instantiated this handler.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">eventHandler</span>:Function</code> &mdash; Method to call when an event occurs.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeout</span>:int</code> (default = <code>0</code>)<code></code> &mdash; Number of milliseconds to wait for an event.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">passThroughData</span>:Object</code> (default = <code>null</code>)<code></code> &mdash; A generic object that can optionally be provided by the 
   developer when setting up an synchronous test.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeoutHandler</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; A method to call if the timeout occurs before the event.
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="handleEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">handleEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function handleEvent(event:Event):void</code><p> 
   A generic handler called by an unknown object when a specific event fires. 
   
   The object and event are known in the TestCase when calling the TestCase.asyncHandler(). 
   This class respond to the event by firing a 'eventFired' event if the event occurred 
   before the specified timeout.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:Event</code> &mdash; The event being listened for.
   </td>
</tr>
</table>
</div>
<a name="handleTimeout()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">handleTimeout</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function handleTimeout(event:TimerEvent):void</code><p> 
   An event handler that is called by our timer if handleEvent is not called 
   before the number of milliseconds specified in the timeout property. 
   
   This method dispatches the 'timerExpired' event to inform the testCase.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:TimerEvent</code></td>
</tr>
</table>
</div>
<a name="startTimer()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">startTimer</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function startTimer():void</code><p> 
   Starts the timeout timer for this test. This method is called by the testCase at
   the end of the method body
   </p></div>
<div class="detailSectionHeader">Event detail</div>
<a name="event:eventFired"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">eventFired</td><td class="detailHeaderType">event&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<span class="label">Event object type: </span><a href="../events/AsyncEvent.html"><code>net.digitalprimates.fluint.events.AsyncEvent</code></a>
<br>
<p></p><p> 
  The 'eventFired' event is fired when the event specified in the 
  TestCase.asyncHandler() method occurs. 
  
  The TestCase pends on this event or the 'timerExpired' event before 
  moving on to the next test method or asynchronous event.
  </p></div>
<a name="event:timerExpired"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">timerExpired</td><td class="detailHeaderType">event&nbsp;</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody"><p> 
  The 'timerExpired' event is fired when the event specified in the 
  TestCase.asyncHandler() method does not occur before the timeout 
  specified in the constructor. The TestCase pends on this event or the 
  'eventFired' event before continuing to the next test method or 
  asynhronouse event.
  </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
